﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Xml.Linq;

public partial class Masterlayout : System.Web.UI.MasterPage
{
    protected void Page_Load(object sender, EventArgs e)
    {
        setCurrentPage();
        
    }
    private void setCurrentPage()
    {
        var pagename = Convert.ToString(GetPageName());
        switch (pagename)
        {
            case "HOME.aspx":
                
                home.Attributes["class"] = "active";
                lishipper.Attributes["class"] = "AAAAA";
                licustomer.Attributes["class"] = "AAAAA";
                liemployees.Attributes["class"] = "AAAAA";
                liorders.Attributes["class"] = "AAAAA";
                liproducts.Attributes["class"] = "AAAAA";
                licategories.Attributes["class"] = "AAAAA";
                lisuppliers.Attributes["class"] = "AAAAA";
                break;
            case "Customer.aspx":
                home.Attributes["class"] = "AAAAA";
                lishipper.Attributes["class"] = "AAAAA";
                licustomer.Attributes["class"] = "active";
                liemployees.Attributes["class"] = "AAAAA";
                liorders.Attributes["class"] = "AAAAA";
                liproducts.Attributes["class"] = "AAAAA";
                licategories.Attributes["class"] = "AAAAA";
                lisuppliers.Attributes["class"] = "AAAAA";
                break;
            case "Shippers.aspx":
                home.Attributes["class"] = "AAAAA";
                lishipper.Attributes["class"] = "active";
                licustomer.Attributes["class"] = "AAAAA";
                liemployees.Attributes["class"] = "AAAAA";
                liorders.Attributes["class"] = "AAAAA";
                liproducts.Attributes["class"] = "AAAAA";
                licategories.Attributes["class"] = "AAAAA";
                lisuppliers.Attributes["class"] = "AAAAA";
                break;
            case "Categories.aspx":
                home.Attributes["class"] = "AAAAA";
                lishipper.Attributes["class"] = "AAAAA";
                licustomer.Attributes["class"] = "AAAAA";
                liemployees.Attributes["class"] = "AAAAA";
                liorders.Attributes["class"] = "AAAAA";
                liproducts.Attributes["class"] = "AAAAA";
                licategories.Attributes["class"] = "active";
                lisuppliers.Attributes["class"] = "AAAAA";
                break;
            case "Employees.aspx":
                home.Attributes["class"] = "AAAAA";
                lishipper.Attributes["class"] = "AAAAA";
                licustomer.Attributes["class"] = "AAAAA";
                liemployees.Attributes["class"] = "active";
                liorders.Attributes["class"] = "AAAAA";
                liproducts.Attributes["class"] = "AAAAA";
                licategories.Attributes["class"] = "AAAAA";
                lisuppliers.Attributes["class"] = "AAAAA";
                break;
            case "Orders.aspx":
                home.Attributes["class"] = "AAAAA";
                lishipper.Attributes["class"] = "AAAAA";
                licustomer.Attributes["class"] = "AAAAA";
                liemployees.Attributes["class"] = "AAAAA";
                liorders.Attributes["class"] = "active";
                liproducts.Attributes["class"] = "AAAAA";
                licategories.Attributes["class"] = "AAAAA";
                lisuppliers.Attributes["class"] = "AAAAA";
                break;
            case "Products.aspx":
                home.Attributes["class"] = "AAAAA";
                lishipper.Attributes["class"] = "AAAAA";
                licustomer.Attributes["class"] = "AAAAA";
                liemployees.Attributes["class"] = "AAAAA";
                liorders.Attributes["class"] = "AAAAA";
                liproducts.Attributes["class"] = "active";
                licategories.Attributes["class"] = "AAAAA";
                lisuppliers.Attributes["class"] = "AAAAA";
                break;
            case "Suppliers.aspx":
                home.Attributes["class"] = "AAAAA";
                lishipper.Attributes["class"] = "AAAAA";
                licustomer.Attributes["class"] = "AAAAA";
                liemployees.Attributes["class"] = "AAAAA";
                liorders.Attributes["class"] = "AAAAA";
                liproducts.Attributes["class"] = "AAAAA";
                licategories.Attributes["class"] = "AAAAA";
                lisuppliers.Attributes["class"] = "active";
                break;
        }
    }

    private object GetPageName()
    {
        return Request.Url.ToString().Split('/').Last();
    }
}
